/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entitas;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Muhammad Fachrurrozy
 */
@Entity
@Table(name="RequestBuku")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name="Buku.Findall", query = "SELECT b FROM Buku b"),
    @NamedQuery(name="Buku.FindById", query="SELECT b From Buku b Where b.id=:")})

public class RequestBuku implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name="idRequestBuku")
    private Integer idRequestBuku;
    @Basic(optional=false)
    @Lob
    @Column(name="judulBuku")
    private String judulBuku;
    @Basic(optional=false)
    @Lob
    @Column(name="pengarang")
    private String pengarang;
    @Basic(optional=false)
    @Lob
    @Column(name="tahunBuku")
    private Integer tahunBuku;
    
    
    public RequestBuku() {
    }

    public RequestBuku(Integer idRequestBuku) {
        this.idRequestBuku = idRequestBuku;
    }

    public RequestBuku(Integer idRequestBuku, String judulBuku, String pengarang, Integer tahunBuku) {
        this.idRequestBuku= idRequestBuku;
        this.judulBuku = judulBuku;
        this.pengarang = pengarang;
        this.tahunBuku = tahunBuku;
    }

    public Integer getIdRequestBuku() {
        return idRequestBuku;
    }

    public void setId(Integer idRequestBuku) {
        this.idRequestBuku = idRequestBuku;
    }

    public String getjudulBuku() {
        return judulBuku;
    }

    public void setjudulBuku(String judulBuku) {
        this.judulBuku = judulBuku;
    }

    public String getpengarang() {
        return pengarang;
    }

    public void setPengarang(String Pengarang) {
        this.pengarang = pengarang;
    }
    public void settahunBuku(Integer tahunBuku) {
        this.tahunBuku = tahunBuku;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idRequestBuku != null ? idRequestBuku.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RequestBuku)) {
            return false;
        }
        RequestBuku other = (RequestBuku) object;
        if ((this.idRequestBuku == null && other.idRequestBuku != null) || (this.idRequestBuku != null && !this.idRequestBuku.equals(other.idRequestBuku))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entitas.RequestBuku[id=" + idRequestBuku + "]";
    }

}
